<?php

if(isset($_POST['submit']))
	{
		
		
		if($_POST['food_name'] != "" && $_POST['calories'] != "")
		{
			$fName = $_POST['food_name'];
			$calories = $_POST['calories'];
				
			require_once 'dbOper.php';
			insertFood($fName, $calories);
		}

	}

?>

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="theme.css">
</head>
<body>
<div id="main">

<form action="<?php $_SERVER['PHP_SELF'];?>" method="post">
<input type="text" placeholder="Type here..." name="food_name" value="<?php echo $fName?>">&nbsp;Food name<br/>
<input type="text" placeholder="Type here..." name="calories"value="<?php echo $calories?>">&nbsp;Calories<br/>
<input type="submit" name="submit" value="Add food">
</form>

</div>
</body>
</html>